CreditCard Users Churn Prediction

by: Garey Salinas


Contents


Background & Context

The Thera bank recently saw a steep decline in the number of users of their credit card, credit cards are a good source of income for banks because of different kinds of fees charged by the banks like annual fees, balance transfer fees, and cash advance fees, late payment fees, foreign transaction fees, and others. Some fees are charged to every user irrespective of usage, while others are charged under specified circumstances.

Customers’ leaving credit cards services would lead bank to loss, so the bank wants to analyze the data of customers and identify the customers who will leave their credit card services and reason for same – so that bank could improve upon those areas

You as a Data scientist at Thera bank need to come up with a classification model that will help the bank improve their services so that customers do not renounce their credit cards


Objective


Data Dictionary

LABELS DESCRIPTIONS
CLIENTNUM Client number. Unique identifier for the customer holding the account
Attrition_Flag Internal event (customer activity) variable - if the account is closed then 1 else 0
Customer_Age Age in Years
Gender Gender of the account holder
Dependent_count Number of dependents
Education_Level Educational Qualification of the account holder
Marital_Status Marital Status of the account holder
Income_Category Annual Income Category of the account holder
Card_Category Type of Card
Months_on_book Period of relationship with the bank
Total_Relationship_Count Total no. of products held by the customer
Months_Inactive_12_mon No. of months inactive in the last 12 months
Contacts_Count_12_mon No. of Contacts in the last 12 months
Credit_Limit Credit Limit on the Credit Card
Total_Revolving_Bal The balance that carries over from one month to the next is the revolving balance
Avg_Open_To_Buy Open to Buy refers to the amount left on the credit card to use (Average of last 12 months)
Total_Trans_Amt Total Transaction Amount (Last 12 months)
Total_Trans_Ct Total Transaction Count (Last 12 months)
Total_Ct_Chng_Q4_Q1 Ratio of the total transaction count in 4th quarter and the total transaction count in 1st quarter
Total_Amt_Chng_Q4_Q1 Ratio of the total transaction amount in 4th quarter and the total transaction amount in 1st quarter
Avg_Utilization_Ratio Represents how much of the available credit the customer spent

Overview of Dataset

top

Importing libraries

Load dataset

Changing object dtype to category

Show duplicated values

Missing values

Exploratory Data Analysis

top

Univariate analysis

Credit_Limit

Avg_Open_To_Buy

Total_Amt_Chng_Q4_Q1

Total_Ct_Chng_Q4_Q1

Avg_Utilization_Ratio

Customer_Age

Dependent_count

Months_on_book

Total_Relationship_Count

Months_Inactive_12_mon

Contacts_Count_12_mon

Total_Revolving_Bal

Total_Trans_Amt

Total_Trans_Ct

Attrition_Flag

Gender

Education_Level

Maritial_Status

Income_Category

Card_Category

Bivariate analysis

Heat map

Data Preparation

top

Model Building

top

Logisitic Regression

top

Running model without upsampling or downsampling

SMOTE to upsample smaller class

Down Sampling the larger class

Decision Tree Classifier

top

Random Tree Classifier

top

Bagging Classifier

top

Gradient Boosting Classifier

top

AdaBoost Classifier

top

XGBoost Classifier

top

Hyperparameter Tuning

top

XGBoostClassifier hyperparameter tuning using GridSearchCV

XGBoostClassifier hyperparameter tuning using RandomizedSearchCV

GradientBoostingClassifier hyperparameter tuning using GridSearchCV

GradientBoostingClassifier hyperparameter tuning using RandomizedSearchCV

RandomForestClassifer hyperparameter tuning using GridSearchCV

RandomForestClassifer hyperparameter tuning using RandomizedSearchCV

Comparing Model Performance

top

Conclusion

top